import java.sql.*;

public class App4 {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Class.forName("com.mysql.jdbc.Driver");
        String url = "jdbc:mysql://localhost:3306/test?useSSL=false";
        String name="root";
        String password="yangxiaocheng3";
        Connection connection = DriverManager.getConnection(url, name, password);
        Statement statement = connection.createStatement();
        String sql="DELETE FROM user WHERE id = 5";
        int i = statement.executeUpdate(sql);
        if(i>0){
            System.out.println("删除成功！");
        }
    }
}
